﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	堆场信息
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <div id="dolphincontainer">
	    <div id="dolphinnav">
	        <ul class="top_tab">
	            <li><a href="/Stack/Index"><span>堆场管理</span></a></li>
                <li><a href="/Stack/Edit/<%=ViewData["id"] %>"><span>基本信息</span></a></li>
                <li><a href="/Stack/Weather/<%=ViewData["id"] %>"><span>气象信息</span></a></li>
                <li><a href="javascript:return(false);" class="current"><span>堆场信息</span></a></li>
                <li><a href="/Stack/Pool/<%=ViewData["id"] %>"><span>调节水池</span></a></li>
                <li><a href="/Stack/Material/<%=ViewData["id"] %>"><span>材料信息</span></a></li>
                <li><a href="/Stack/Settle/<%=ViewData["id"] %>"><span>沉降模型</span></a></li>
                <li><a href="/Stack/Piezometer/<%=ViewData["id"] %>"><span>测压井测压仪</span></a></li>
                <li><a href="/Stack/Drain/<%=ViewData["id"] %>"><span>导渗系统</span></a></li>
                <li><a href="/Position/List?type=1&stackId=<%=ViewData["id"] %>"><span>上传图片</span></a></li>
	        </ul>
	    </div>
	</div>

    
    <% 
    int layerNum = 2;
    using (Html.BeginForm())
    {
        Seperator_Dike_Base_Info dike = (Seperator_Dike_Base_Info)ViewData["dike"];
        Stack_Base_Info stackBaseInfo = (Stack_Base_Info)ViewData["stackBaseInfo"];
        Stack_Base_Layer_Info[] stackBaseLayerInfos = (Stack_Base_Layer_Info[])ViewData["stackBaseLayerInfos"];
        Stack_Base_Layer_Info sencondLayer = stackBaseLayerInfos[0];
    %>
        
        <%= Html.ValidationSummary(true) %>
        <%= Html.Hidden("id", dike.stack_id) %>
        <%
           bool result = (bool)ViewData["success"];
           if(result){ 
        %>
           <div class="tips_area">堆场信息更新成功</div>
        <%
        }
        %>
            
    
    <fieldset class="tf_style">
        <legend>渣场信息（起坡平面以下）</legend>
        
        <table cellpadding="4" cellspacing="0" class="com_detail_table2">
            <tr>
                <td class="lab" style="width:120px;">分隔坝底部高程：</td>
                <td>
                    <%= Html.TextBox("seperator_dike_base_El", dike.seperator_dike_base_El, new { style = "width:50px;" })%>
                </td>
                <td class="lab" style="width:120px;">分隔坝顶部高程：</td>
                <td>
                    <%= Html.TextBox("seperator_dike_top_El", dike.seperator_dike_top_El, new { style = "width:50px;" })%>
                </td>
            </tr>

            <tr>
                <td class="lab">分隔坝一侧斜度：</td>
                <td>
                    <%= Html.TextBox("seperator_dike_1_tilt_rate", dike.seperator_dike_1_tilt_rate, new { style = "width:50px;" })%>
                </td>
                <td class="lab">分隔坝另一侧斜度：</td>
                <td>
                    <%= Html.TextBox("seperator_dike_2_tile_rate", dike.seperator_dike_2_tile_rate, new { style = "width:50px;" })%>
                </td>
            </tr>

            <tr>
                <td class="lab">
                    I区高程－面积数据<br />
                   (高程-面积)：
                </td>
                <td>
                    <%= Html.TextArea("bottomEls1", (string)ViewData["bottomEls1"], new {rows="12", cols="20" })%>
                </td>
                <td class="lab">
                    II区高程－面积数据<br />
                   (高程-面积)：
                </td>
                <td>
                    <%= Html.TextArea("bottomEls2", (string)ViewData["bottomEls2"], new { rows = "12", cols = "20" })%>
                </td>
            </tr>
        </table>

    </fieldset>

    <fieldset id="dams" class="tf_style">
        <legend>渣场信息（起坡平面以上）</legend>
        
        <table cellpadding="4" cellspacing="0" class="com_detail_table2">
            <tr >
                <th colspan="2" style="text-align:center;">大堤</th>
                <th colspan="2" style="text-align:center;">第1层</th>
                <th colspan="2" style="text-align:center;">第2层</th>
            </tr>
            <tr>
                <td class="lab" style="width:120px;">初期坝的边坡斜度：</td>
                <td><%=Html.TextBox("initial_dike_tilt_rate", stackBaseInfo.initial_dike_tilt_rate, new { style = "width:50px;" })%></td>
                <td class="lab" style="width:120px;">坡面斜度：</td>
                <td><%=Html.TextBox("first_layer_tilt_rate", stackBaseInfo.first_layer_tilt_rate, new { style = "width:50px;" })%></td>
                <td class="lab" style="width:120px;">坡面斜度：</td>
                <td><%=Html.TextBox("layer_tilt_rate2", sencondLayer.layer_tilt_rate, new { style = "width:50px;" })%></td>
            </tr>
            <tr>
                <td class="lab">渣场底部高程：</td>
                <td><%=Html.TextBox("stack_base_contour", stackBaseInfo.stack_base_contour, new { style = "width:50px;" })%></td>
                <td class="lab">坡底水沟的宽度：</td>
                <td><%=Html.TextBox("first_layer_ditch_width", stackBaseInfo.first_layer_ditch_width, new { style = "width:50px;" })%></td>
                <td class="lab">磷石膏坝顶宽度：</td>
                <td><%=Html.TextBox("layer_dike_width2", sencondLayer.layer_dike_width, new { style = "width:50px;" })%></td>
            </tr>
            <tr>
                <td class="lab">X方向基点：</td>
                <td><%=Html.TextBox("stack_base_x", stackBaseInfo.stack_base_x, new { style = "width:50px;" })%></td>
                <td class="lab">坡底水沟的高程：</td>
                <td><%=Html.TextBox("first_layer_ditch_El", stackBaseInfo.first_layer_ditch_El, new { style = "width:50px;" })%></td>
                <td class="lab">磷石膏坝顶高程：</td>
                <td><%=Html.TextBox("layer_dike_El2", sencondLayer.layer_dike_El, new { style = "width:50px;" })%></td>
            </tr>
            <tr>
                <td class="lab">&nbsp;</td>
                <td>&nbsp;</td>
                <td class="lab">&nbsp;</td>
                <td>&nbsp;</td>
                <td class="lab">水沟底部宽度：</td>
                <td><%=Html.TextBox("layer_ditch_width2", sencondLayer.layer_ditch_width, new { style = "width:50px;" })%></td>
            </tr>
            <tr>
                <td class="lab">&nbsp;</td>
                <td>&nbsp;</td>
                <td class="lab">&nbsp;</td>
                <td>&nbsp;</td>
                <td class="lab">水沟左侧斜度：</td>
                <td><%=Html.TextBox("layer_ditch_tilt_rate2", sencondLayer.layer_ditch_tilt_rate, new { style = "width:50px;" })%></td>
            </tr>
            <tr>
                <td class="lab">&nbsp;</td>
                <td>&nbsp;</td>
                <td class="lab">&nbsp;</td>
                <td>&nbsp;</td>
                <td class="lab">水沟深度：</td>
                <td><%=Html.TextBox("layer_ditch_depth2", sencondLayer.layer_ditch_depth, new { style = "width:50px;" })%></td>
            </tr>

        </table>

        <div id="layers">
        
            <%
            for (int i = 1;i < stackBaseLayerInfos.Length; i++, layerNum++)
            {
                Stack_Base_Layer_Info layer = stackBaseLayerInfos[i];
            %>
            <div id="layer<%=layerNum + 1 %>">

                <table cellpadding="4" cellspacing="0" class="com_detail_table2" style=" float:left; margin:8px 8px 0 0; width:234px;">
                    <tr>
                        <th colspan="2" align="center" style="text-align:center">第<%=layerNum + 1 %>层<a class="a_color39f" style='float:right; margin-right:5px' href='javascript:return void(0);' onclick='removeLayer(<%=layerNum + 1 %>)'>X</a></th>
                    </tr>
                    <tr>
                        <td class="lab" style="width:120px;">坡面斜度：</td>
                        <td><%=Html.TextBox("layer_tilt_rate" + (layerNum + 1), layer.layer_tilt_rate, new { style = "width:50px;" })%></td>
                    </tr>
                    <tr>
                        <td class="lab">磷石膏坝顶宽度：</td>
                        <td><%=Html.TextBox("layer_dike_width" + (layerNum + 1), layer.layer_dike_width, new { style = "width:50px;" })%></td>
                    </tr>
                    <tr>
                        <td class="lab">磷石膏坝顶高程：</td>
                        <td><%=Html.TextBox("layer_dike_El" + (layerNum + 1), layer.layer_dike_El, new { style = "width:50px;" })%></td>
                    </tr>
                    <tr>
                        <td class="lab">水沟底部宽度：</td>
                        <td><%=Html.TextBox("layer_ditch_width" + (layerNum + 1), layer.layer_ditch_width, new { style = "width:50px;" })%></td>
                    </tr>
                    <tr>
                        <td class="lab">水沟左侧斜度：</td>
                        <td><%=Html.TextBox("layer_ditch_tilt_rate" + (layerNum + 1), layer.layer_ditch_tilt_rate, new { style = "width:50px;" })%></td>
                    </tr>
                    <tr>
                        <td class="lab">水沟深度：</td>
                        <td><%=Html.TextBox("layer_ditch_depth" + (layerNum + 1), layer.layer_ditch_depth, new { style = "width:50px;" })%></td>
                    </tr>
                </table>

            </div>
            <% } %>
        </div>

        <p style="clear:both; padding:8px 0 12px 0;"><input type="button" value="添加层级信息" onclick="addLayer();" /></p>


        <p>高程－面积数据 (高程-面积-边坡面积)</p>
        <%= Html.TextArea("aboveEls", (string)ViewData["aboveEls"], new { rows = "12", cols = "20" })%>

    </fieldset>
  
    
    <div class="submit_btn_area" style="margin-left:132px;">
        <%= Html.Hidden("totalLayerNum", layerNum) %>
        <input type="submit" value="提 交" />
    </div>

    <% } %>

    <script type="text/javascript"" language="javascript">
        var layerNum = <%= layerNum%>;
        function getInnerHtml(layerNo)
        {
            //var htmlStr = "<div style='float:left' id='layer" + layerNo + "'><table class='tableCss'  cellspacing='0' cellpadding='0' align='center' border='1' style='margin-top:10px;margin-bottom:10px;width:250px'><tr><th colspan='2' align='center' style='text-align:center'>第" + layerNo + "层<a style='float:right;margin-right:5px' href='javascript:return void(0);' onclick='removeLayer(" + layerNo +")'>X</a></th></tr><tr><td class='row1'>坡面斜度</td><td class='row1'><input type='textbox' name='layer_tilt_rate" + layerNo + "' /></td></tr><tr><td class='row1'>磷石膏坝顶宽度</td><td class='row1'><input type='textbox' name='layer_dike_width" + layerNo + "' /></td></tr><tr><td class='row1'>磷石膏坝顶高程</td><td class='row1'><input type='textbox' name='layer_dike_El" + layerNo + "' /></td></tr><tr><td class='row1'>水沟底部宽度</td><td class='row1'><input type='textbox' name='layer_ditch_width" + layerNo + "' /></td></tr><tr><td class='row1'>水沟左侧斜度</td><td class='row1'><input type='textbox' name='layer_ditch_tilt_rate" + layerNo + "' /></td></tr><tr><td class='row1'>水沟深度</td><td class='row1'><input type='textbox' name='layer_ditch_depth" + layerNo + "' /></td></tr></table></div>";				
	        
            var htmlStr = "<div id='layer" + layerNo + "'><table cellpadding='4' cellspacing='0' class='com_detail_table2' style=' float:left; margin:8px 8px 0 0; width:234px;'><tr><th colspan='2' align='center' style='text-align:center'>第" + layerNo + "层<a class='a_color39f' style='float:right; margin-right:5px' href='javascript:return void(0);' onclick='removeLayer(" + layerNo +")'>X</a></th></tr><tr><td class='lab' style='width:120px;'>坡面斜度：</td><td><input type='text' size='4' name='layer_tilt_rate" + layerNo + "' /></td></tr><tr><td class='lab'>磷石膏坝顶宽度：</td><td><input type='text' size='4' name='layer_dike_width" + layerNo + "' /></td></tr><tr><td class='lab'>磷石膏坝顶高程：</td><td><input type='text' size='4' name='layer_dike_El" + layerNo + "' /></td></tr><tr><td class='lab'>水沟底部宽度：</td><td><input type='text' size='4' name='layer_ditch_width" + layerNo + "' /></td></tr><tr><td class='lab'>水沟左侧斜度：</td><td><input type='text' size='4' name='layer_ditch_tilt_rate" + layerNo + "' /></td></tr><tr><td class='lab'>水沟深度：</td><td><input type='text' size='4' name='layer_ditch_depth" + layerNo + "' /></td></tr></table></div>";				
	        
            
            return htmlStr;
        }        
        
        function addLayer() {
            layerNum++;
            $("#layers").append(getInnerHtml(layerNum));
            document.getElementById("totalLayerNum").value = layerNum;
        }

        function removeLayer(layerNo) {
            layerNum--;
            $("#layer" + layerNo).remove();
            document.getElementById("totalLayerNum").value = layerNum;
        }

    </script>
</asp:Content>
